Functions are schema objects that consist a set of SQL statements and stored in the server. In the main window, click
Function to open the function object list.
Function Designer is the basic Navicat tool for working with functions. You can enter a valid SQL statement in the Definition tab. This can be a simple statement such as SELECT or INSERT, or it can be a compound statement written using BEGIN and END. To customize the view of the editor and find out more features for SQL editing, see SQL Editor for details.
To execute the function, click
on the toolbar. If the SQL statement is correct, the statement will be executed and, if the statement is supposed to return data, the Result tab opens with the data returned. If an error occurs while executing the function, execution stops, the appropriate error message is displayed. If the function requires input parameters, the Input Parameters dialog will pop up. Check the Raw Mode option to pass the inputted values to the function without quotation marks.
Note: Navicat supports to return 10 result sets.
Before debugging PL/pgSQL functions, you need to install the pldbgapi extension or enable the debugger plugin manually in the server.
Then, open a PL/pgSQL function. You can add/remove breakpoints for debugging by clicking
in the grey area beside each statement.
Click
on the toolbar to launch the PostgreSQL Debugger. Enter the input parameters if necessary.